import { observable } from 'mobx'

const counterStore = observable({
  counter: 0,
  counterStore() {
    this.counter++
  },
  increment() {
    this.counter++
  },
  decrement() {
    this.counter--
  },
  incrementAsync() {
    setTimeout(() => {
      this.counter++
    }, 1000)
  }
})

const toastStore = observable({
  isShow: false,
  message: '',
  color: 'success',
  show() {
    this.isShow = true
  },
  hide() {
    this.isShow = true
  },
  success() {
    this.show()
  },
  error() {
    this.show()
  },
  warning() {
    this.show()
  }
})

export default {
  counterStore,
  toastStore
}